package edu.uc.serviceimpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import edu.uc.bean.News;
import edu.uc.dao.NewsDao;
import edu.uc.service.NewsService;

@Service("newsService")
public class NewsServiceImpl extends BaseServiceImpl<News> implements NewsService{
	
	private NewsDao newsDao = null;
	
	public NewsDao getNewDao() {
		return newsDao;
	}
	
	@Autowired
	@Qualifier("newsDao")
	public void setNewDao(NewsDao newsDao) {
		this.newsDao = newsDao;
	}

	@Override
	public Long insert(News bean) {
		// TODO Auto-generated method stub
		return newsDao.insert(bean);
	}

	@Override
	public Long delete(Long id) {
		// TODO Auto-generated method stub
		return newsDao.delete(id);
	}

	@Override
	public Long update(News bean) {
		// TODO Auto-generated method stub
		return newsDao.update(bean);
	}

	@Override
	public News load(Long id) {
		// TODO Auto-generated method stub
		return newsDao.load(id);
	}

	@Override
	public List<News> list() {
		// TODO Auto-generated method stub
		return newsDao.list();
	}

	@Override
	public Long count() {
		// TODO Auto-generated method stub
		return newsDao.count();
	}

	@Override
	public Long countByName(String name) {
		// TODO Auto-generated method stub
		return newsDao.countByName(name);
	}

	@Override
	public News loadByName(String name) {
		// TODO Auto-generated method stub
		return newsDao.loadByName(name);
	}

	@Override
	public List<News> pager(Long pageNum, Long pageSize) {
		// TODO Auto-generated method stub
		return newsDao.pager(pageNum, pageSize);
	}

	@Override
	public List<News> pagerByName(String name, Long pageNum, Long pageSize) {
		// TODO Auto-generated method stub
		return newsDao.pagerByName(name, pageNum, pageSize);
	}

}
